home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows 3-Pak 2 - Disc 2
/
Infomagic - Windows 3-Pak Volume 2 (Disc 2 of 3).iso
/
Chat---IRC
/
TURBOIRC.ZIP
/
data1.cab
/
TurboIRC_Scripts
/
EHANGMANGAME.txt
< prev
next >
Wrap
Text File
|
1999-05-05
|
2KB
|
111 lines
// Hang Man Game TurboIRC Script
// By Chourdakis Michael ⌐ 1998
int Size = GetInt("Word","Size",0,".\\HGWORD.INI")
string Given = strupr("$4")
string ToShow = ""
string Z = ""
string mL = ""
int F = 0
string KrZ = ""
int LP = 0
int Found = 0
if (strnicmp("$3*",":!letter ",8)== 0)
goto LetterChoice
endif
if (strnicmp("$3*",":!word ",6)== 0)
goto WordChoice
endif
// no relative text
return
:WordChoice
string VW = strupr("$4")
if (VW==GuessWord)
/display $channel ConGraTuLaTiOnS you found the SecReT Word was %GuessWord% !
/display $channel *******GAME OVER*******
/destroystaticvariable GuessWord
/destroystaticvariable HangTries
/_event HANGMANGAME 0 0 0 *
return
else
/display $channel BooHaHa It is NOT that word !
HangTries += 1
goto NotFound
endif
:LetterChoice
// in a game !
// $4 has the letter
// Is it found in the GuessWord ?
if (FindStringPos(GuessWord,Given)==-1)
// NOT FOUND !!!
/display $channel BooHaHa Letter %Given% is NOT in the hidden word !
HangTries += 1
goto NotFound
else
// FOUND !
goto FoundLetter
endif
:NotFound
if (HangTries == 10)
/display $channel UHHHOH you didn't find the SecReT Word was %GuessWord% !
/display $channel *******GAME OVER*******
/destroystaticvariable GuessWord
/destroystaticvariable HangTries
/_event HANGMANGAME 0 0 0 *
return
else
int V = 10 - HangTries
/display $channel WaTcH It You have OnLy %V% tries left !
endif
goto ShowWordStatus
:FoundLetter
/display $channel WoW Letter %Given% is found in the hidden word !
for (LP = 0 ; LP < Size ; LP += 1)
if (strncmp(GuessWord + LP,Given,1) == 0)
// it is in place
Z = sprintf("Letter%i",LP)
SetString("Word",Z,"1",".\\HGWORD.INI")
endif
endfor
:ShowWordStatus
Found = 0
for (LP = 0 ; LP < Size ; LP += 1)
KrZ = sprintf("Letter%i",LP)
mL = GetString("Word",KrZ,"0",".\\HGWORD.INI")
F = atoi(mL)
if (F == 0)
ToShow = strcat(ToShow,"_ ")
Found = 1
else
ToShow = strncat(ToShow,GuessWord + LP,1)
ToShow = strcat(ToShow," ")
endif
endfor
/display $channel Word Status : %ToShow%
if (Found == 0)
// found ALL !
/display $channel ConGraTuLaTiOnS you found the SecReT Word was %GuessWord% !
/display $channel *******GAME OVER*******
/destroystaticvariable GuessWord
/destroystaticvariable HangTries
/_event HANGMANGAME 0 0 0 *
endif